<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>${user.username }的个人信息</title>
</head>
<!-- <myright> <a href="/ss/">测试一个神级技能 </a></myright> -->
<body>
	<div class="row">
		<div class="col-md-8">
			<div class="panel panel-default">
				<div class="panel-body">
					<div class="media">
						<div class="media-left">
							<img src="${user.avatar }">
						</div>
						<div class="media-body">
							<h3 class="media-heading">
								&nbsp;&nbsp;<span class="glyphicon glyphicon-user"></span>&nbsp;&nbsp;${user.username }
							</h3>
							<h3>
								&nbsp;&nbsp;<span class="glyphicon glyphicon-envelope"></span>&nbsp;&nbsp;${user.email}
							</h3>
						</div>
					</div>
					<ul class="nav nav-tabs">
						<li <c:if test="${operate == 0 }">class="active"</c:if>><a
							href="user/${user.id }/0"><span
								class="glyphicon glyphicon-home"></span></a></li>
						<li <c:if test="${operate == 1 }">class="active"</c:if>><a
							href="user/${user.id }/1">文章</a></li>
						<li <c:if test="${operate == 2 }">class="active"</c:if>><a
							href="user/${user.id }/2">评论</a></li>
						<li <c:if test="${operate == 3 }">class="active"</c:if>><a
							href="user/${user.id }/3">留言</a></li>
						<li <c:if test="${operate == 4 }">class="active"</c:if>><a
							href="user/${user.id }/4">建议</a></li>
					</ul>

				</div>
			</div>
		</div>
	</div>
	<c:if test="${not empty objects }">
		<div class="row">
			<div class="col-md-8">
				<div class="list-group">
					<c:if test="${operate == 0 }">
						<div class="row">
							<div class="col-md-12">
								<div class="panel panel-warning">
									<div class="panel-heading">
										<span class="glyphicon glyphicon-calendar"></span>&nbsp;最新文章
									</div>
									<c:if test="${empty objects[0] }">
										<div class="panel-body">
											<h4 align="center">
												<span class="glyphicon glyphicon-pushpin"></span>
												&nbsp;&nbsp;最近没有新文章发表<a href="article/add">去写一篇</a>
											</h4>
										</div>
									</c:if>
									<c:forEach items="${objects[0]}" var="a">
										<a href="article/" class="list-group-item"> &nbsp;&nbsp;
											${a.title}
											<div class="pull-right" style="font-size: 12px;">
												<span class="glyphicon glyphicon-calendar"></span>&nbsp;
												<fmt:formatDate value="${a.time }" pattern="yyyy年MM月dd日" />
											</div>
										</a>
									</c:forEach>
								</div>
							</div>
						</div>
						<br>
						<a class="list-group-item active"><span
							class="glyphicon glyphicon-calendar"></span> 最新评论 </a>
						<c:if test="${empty objects[1] }">
							<div class="row">
								<div class="col-md-12">
									<div class="panel panel-danger">
										<div class="panel-heading">
											<h4 align="center">
												<span class="glyphicon glyphicon-pushpin"></span>
												&nbsp;&nbsp;最近没有评论别人的言论
											</h4>
										</div>
									</div>
								</div>
							</div>
						</c:if>
						<c:forEach items="${objects[1]}" var="c">
							<a href="article/" class="list-group-item"> &nbsp;&nbsp;
								${c.content }
								<div class="pull-right" style="font-size: 12px;">
									<span class="glyphicon glyphicon-calendar"></span>&nbsp;
									<fmt:formatDate value="${c.time }" pattern="yyyy年MM月dd日" />
								</div>
							</a>
						</c:forEach>
						<br>
						<a class="list-group-item active"><span
							class="glyphicon glyphicon-calendar"></span> 最新留言 </a>
						<c:if test="${empty objects[2] }">
							<div class="row">
								<div class="col-md-12">
									<div class="panel panel-danger">
										<div class="panel-heading">
											<h4 align="center">
												<span class="glyphicon glyphicon-pushpin"></span>
												&nbsp;&nbsp;最近没有留言内容
											</h4>
										</div>
									</div>
								</div>
							</div>
						</c:if>
						<c:forEach items="${objects[2]}" var="m">
							<a href="message/" class="list-group-item">
								<div class="pull-right" style="font-size: 12px;">
									<span class="glyphicon glyphicon-calendar"></span>&nbsp;
									<fmt:formatDate value="${m.time }" pattern="yyyy年MM月dd日" />
								</div> &nbsp;&nbsp; ${m.message }
							</a>
						</c:forEach>
						<br>
						<a class="list-group-item active"><span
							class="glyphicon glyphicon-calendar"></span> 最新建议 </a>
						<c:if test="${empty objects[3] }">
							<div class="row">
								<div class="col-md-12">
									<div class="panel panel-danger">
										<div class="panel-heading">
											<h4 align="center">
												<span class="glyphicon glyphicon-pushpin"></span>
												&nbsp;&nbsp;最近没有提出新的建议
											</h4>
										</div>
									</div>
								</div>
							</div>
						</c:if>
						<c:forEach items="${objects[3]}" var="p">
							<a href="propose/" class="list-group-item">
								<button type="button" class="close" data-dismiss="alert"
									aria-label="Close">
									<span aria-hidden="true">&times;</span>
								</button> &nbsp;&nbsp; ${p.propose }
							</a>
						</c:forEach>
					</c:if>
					<c:if test="${operate == 1 }">
						<a class="list-group-item active"><span
							class="glyphicon glyphicon-star"></span> 文章 </a>
						<c:forEach items="${objects}" var="o">
							<a href="article/" class="list-group-item"> &nbsp;&nbsp;
								${o.title}
								<div class="pull-right" style="font-size: 12px;">
									<span class="glyphicon glyphicon-calendar"></span>&nbsp;
									<fmt:formatDate value="${o.time }" pattern="yyyy年MM月dd日" />
								</div>
							</a>
						</c:forEach>
					</c:if>
					<c:if test="${operate == 2 }">
						<a class="list-group-item active"><span
							class="glyphicon glyphicon-star"></span> 评论</a>
						<c:forEach items="${objects}" var="o">
							<a href="article/" class="list-group-item"> &nbsp;&nbsp;
								${o.content }
								<div class="pull-right" style="font-size: 12px;">
									<span class="glyphicon glyphicon-calendar"></span>&nbsp;
									<fmt:formatDate value="${o.time }" pattern="yyyy年MM月dd日" />
								</div>
							</a>
						</c:forEach>
					</c:if>
					<c:if test="${operate == 3 }">
						<a class="list-group-item active"><span
							class="glyphicon glyphicon-star"></span> 留言 </a>
						<c:forEach items="${objects}" var="o">
							<a href="message/" class="list-group-item">
								<div class="pull-right" style="font-size: 12px;">
									<span class="glyphicon glyphicon-calendar"></span>&nbsp;
									<fmt:formatDate value="${o.time }" pattern="yyyy年MM月dd日" />
								</div> &nbsp;&nbsp; ${o.message }
							</a>
						</c:forEach>
					</c:if>
					<c:if test="${operate == 4 }">
						<a class="list-group-item active"><span
							class="glyphicon glyphicon-star"></span> 建议 </a>
						<c:forEach items="${objects}" var="o">
							<a href="propose/" class="list-group-item">
								<button type="button" class="close" data-dismiss="alert"
									aria-label="Close">
									<span aria-hidden="true">&times;</span>
								</button>&nbsp;&nbsp; ${o.propose }
							</a>
						</c:forEach>
					</c:if>
				</div>
			</div>
		</div>
	</c:if>
	<c:if test="${empty objects }">
		<div class="row">
			<div class="col-md-8">
				<div class="panel panel-danger">
					<div class="panel-heading">
						<h4 align="center">
							<span class="glyphicon glyphicon-pushpin"></span>
							&nbsp;&nbsp;暂时没有相关内容
						</h4>
					</div>
				</div>
			</div>
		</div>
	</c:if>

</body>
</html>